(function() {
  $(function() {
    var form;
    form = $('form.main');
    form.form({
      inline: true,
      fields: {
        bin_num: 'empty',
        issuer_code: 'empty',
        issuer_name: 'empty',
        card_name: 'empty',
        debit_credit_flag: 'empty',
        bin_len: 'empty',
        card_no_len: 'empty'
      }
    });
    return $('#search').click(function() {
      return $.post('/p2/blacklist/cardbin', {
        bin_num: $("input[name='bin_num']").val()
      }, function(data) {
        var cardbin;
        console.log(data.cardbin);
        cardbin = JSON.parse(data.cardbin);
        if (data.succ) {
          return form.form('set values', cardbin);
        }
      });
    });
  });

}).call(this);
